This R01 proposal seeks to pair medication-assisted treatment (MAT) with an evidence-based, smartphone- delivered relapse prevention system (A-CHESS) to improve long-term recovery from opioid use disorders. Although MAT has been shown to be effective for opioid dependence, the high rate of relapse suggests that MAT is not enough. Long-term recovery remains a challenge. Our hope is that A-CHESS will help patients transfer the skills they learn in treatment into their daily lives after treatment and as a result, have greater success in sustained recovery. A-CHESS also will include tools for improving outcomes related the hepatitis C virus and HIV-infections that disproportionately affect opioid-dependent people. The project also seeks to understand which elements of treatment work for whom and why so that interventions, especially mobile health interventions, can be made more effective. The proposal builds upon evidence that A-CHESS improves outcomes among those suffering from alcohol and opioid use disorders. In one randomized trial, patients leaving residential treatment for alcohol use disorders who had A-CHESS had 57% fewer risky drinking days than those without it, an effect that was even greater among patients who had been opioid- as well as alcohol- dependent. In a pilot test, A-CHESS was bundled with MAT to treat transient veterans with documented alcohol use disorders and, anecdotally, high rates of other drug use. This test found that readmissions to residential detox decreased 71% for those with A-CHESS compared to those without it. This study proposes a randomized clinical trial of 24 months, with patients from 3 treatment agencies assigned either to MAT + A- CHESS or MAT alone. The primary aim of the project is to determine the difference between the two groups in opioid use days. Secondarily, we want to detect differences in quality of life; retention in treatment; unscheduled use of health services; and, for HCV and HIV, screening rates, risk behaviors, testing, and among those infected, treatment initiation. We will also test the 4 factors that we hypothesize mediate the relationship between the interventions and outcomes: the 3 constructs of self-determination theory-competence, relatedness, and intrinsic motivation-plus negative affect. We also seek to understand factors that affect the strength of the relationship between intervention and outcome, which we hypothesize are gender and-among those who have A-CHESS-communication style in discussion groups. Through qualitative research, we will explore (1) the differences between people who respond better to MAT + A-CHESS vs. those who do not, (2) the struggles in implementing and sustaining the interventions, and (3) the relationship between outcomes and using A-CHESS. The proposed project offers an innovative approach to a nearly intractable and increasingly common problem. The project is significant both for its potential to improve long-term treatment outcomes and to create and share new knowledge and understanding about factors that can be used to tailor future treatments for greater effectiveness and reach.